// MainFrm.h : interface of the CMainFrame class
//


#pragma once

#include "LopApi.h"

interface IGraphBuilder2;
class CChildView;
class CSkinWnd;
class COpenMediaData;
class COpenFileData;
class CFullscreenWnd;
class CVMROSD;
interface IBufferInfo;
class CPlayerImpl;

class CMainFrame : public CFrameWnd
{	
protected: 
	DECLARE_DYNAMIC(CMainFrame)

// Attributes
public:

// Operations
public:

// Overrides
public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
	virtual BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult);

// Implementation
public:
	CMainFrame();
	virtual ~CMainFrame();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

// Generated message map functions
protected:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSetFocus(CWnd *pOldWnd);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnMove(int x, int y);
	afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
	afx_msg void OnFileOpen();
	afx_msg void OnDestroy();
	afx_msg void OnFileClose();
	afx_msg void OnPlayPlaypause();
	afx_msg void OnPlayStop();
	afx_msg void OnNavigateBack();
	afx_msg void OnNavigateNext();
	afx_msg LRESULT OnGraphNotify(WPARAM, LPARAM);
	afx_msg LRESULT OnVideoSize(WPARAM, LPARAM lParam);
	DECLARE_MESSAGE_MAP()
private:
	CAutoPtr<CPlayerImpl>		m_pPlayerImpl;
	CAutoPtr<CChildView>		m_pwndView;
	CAutoPtr<CSkinWnd>			m_pSkinFrame;
	CWinThread*					m_pGraphThread;
	CAutoPtr<CFullscreenWnd>	m_pFullscreenWnd;
	LOP_LOADSTATE				m_iMediaLoadState;
	INT							m_iPlaybackMode;
	CWnd						*m_pVideoWnd;
private:
	void ResetClientPos(void);
	LOP_LOADSTATE GetState() const			{ return m_iMediaLoadState; }
	void SetState(LOP_LOADSTATE iState)		{ m_iMediaLoadState = iState; }
	BOOL CreateFullScreenWindow();
	void MoveVideoWindow(void);
};


